﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
using System.Configuration;

namespace myomscl.DataObjects
{
    public abstract class SqlBaseDal
    {
        #region Private Fields

        private static string connectionString;

        #endregion

        #region Properties

        public static string ConnectionString
        {
            get
            {
                return connectionString;
            }
            set
            {
                connectionString = value;
            }
        }

        #endregion

        #region Constructor

        protected SqlBaseDal()
        {
            var connectionSettings = ConfigurationManager.ConnectionStrings["Sitecore_Workflow_EstateConnectionString"];
            connectionString = connectionSettings.ConnectionString;
        }
        #endregion

        #region Base methods

        protected SqlConnection GetConnection()
        {
            return new SqlConnection(ConnectionString);
        }

        #endregion
    }
}
